package com.googlecode.jvmpart.proc;

import java.util.Map;

import com.googlecode.jvmpart.Partitioner;

/**
 * The interface for processing your business logic inside a separted java process
 * @author chunzhan
 *
 */
public interface JvmProcess {
	public static final int EXIT_CODE_FAILED = -1;
	public static final int EXIT_CODE_NORMAL = 0;
	public static final String PARAMS_ENCODING = "UTF-8";
	public static final String PARAMS_SEPERATER = "=";
	public static final String PARAMS_DELIMIT = "&";
	public static final String SENSITIVE_PREFIX = "_s_";
	public static final String JDBC_USER = "_s_jdbc_resu";
	public static final String JDBC_PASSWORD = "_s_jdbc_drowssap";
	public static final String JDBC_DRIVER = "_s_jdbc_driver";
	public static final String JDBC_URL = "_s_jdbc_url";
	public static final String PARAM_START = "_start";
	public static final String PARAM_LIMIT = "_limit";
	public static final String PARAM_URL = "_url";
	/**
	 * Implements the interface for processing your business logic
	 * @param ppid parent process id
	 * @param params the partitioned parameters {@link Partitioner}
	 * @throws Exception Root exception for cheching java process execute
	 */
	public void execute(String ppid, Map <String, String> params) throws JvmProcessException;
}
